/**
 * Created by Dalyn on 2017/3/16.
 */
import Relay from "react-relay";

export default class OrderTradeInfoMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { orderTradeInfo }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId:this.props.oid,
                enid:this.props.enid,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on orderTradeInfoPayload {
            orderTradeInfo {  
                errorCode
                value
                totalResult
                id
                order{
                    oid
                    contractId
                    partAName
                    partBName
                    orderGoodsNum
                    account
                    payAccount
					  orderType
					  signedContract
                }
				subOrders{
					oid
                    contractId
                    partAName
                    partBName
                    orderGoodsNum
                    account
                    payAccount
                    orderType
                    signedContract
				}
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on orderTradeInfoPayload {
                    orderTradeInfo {
                        errorCode
                        value
                        totalResult
                        id
                        order{
							oid
							contractId
							partBName
							partAName
							orderGoodsNum
							account
							payAccount
							orderType
							signedContract
						}
						subOrders{
							oid
							contractId
							partAName
							partBName
							orderGoodsNum
							account
							payAccount
							orderType
							signedContract
						}
                    }
                }
            `]
        }];
    }
}